Skip to content

Create utils code to name#13

Merged
lbm364dl merged 8 commits into
mainfrom
catalin/create-utils-code-to-name
May 20, 2025
Merged

Create utils code to name#13
lbm364dl merged 8 commits into
mainfrom
catalin/create-utils-code-to-name

Conversation

@lbm364dl

@lbm364dl lbm364dl commented May 20, 2025

Copy link
Copy Markdown
Collaborator

We shouldn't be dragging both codes and actual names of tibble columns all the time but rather only work with codes, which is less error prone and more efficient. This PR adds some helper functions to add the equivalent column in a given tibble, e.g., add_area_name adds a name column to a tibble that already contains a code column, and add_area_code adds a code column to a tibble that already contains a name column.

I also became aware of Tidyverse recommendation for dealing with tidy selection R CMD Check notes, which is not how we are doing it (we are currently ignoring warnings using utils::globalVariables). In the next PR I will try to:

  • Fix this not recommended usage. Start using the approach given in the link above.
  • Remove natural name columns from all our data, only work with codes, and leave names for debugging/visualization by using the provided utils functions.

@lbm364dl lbm364dl requested a review from eduaguilera May 20, 2025 09:02
@lbm364dl lbm364dl marked this pull request as ready for review May 20, 2025 09:03
Comment thread inst/extdata/input/raw/items.csv
Comment thread inst/extdata/input/raw/regions.csv
@lbm364dl lbm364dl requested a review from eduaguilera May 20, 2025 10:53
@lbm364dl lbm364dl merged commit bde3983 into main May 20, 2025
7 checks passed
@lbm364dl lbm364dl deleted the catalin/create-utils-code-to-name branch May 20, 2025 14:32
lbm364dl added a commit that referenced this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants